package cn.xinfei.xdecision.common.migrate;


import cn.xinfei.xdecision.common.model.datax.migrate.Element;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigInteger;
import java.util.Collection;
import java.util.List;
import java.util.Set;

public interface ElementMapper {


    List<Element> getElementsByIds(List<String> elements);

    List<Element> getElement(@Param("type") String type, @Param("name") String name);

    List<Element> getAllInputFuncElement();

    List<Element> getAllElement();

    List<Element> getAllModelElements();

    List<Element> getAllThirdpartyCacheElements();

    List<Element> getAllModelCacheElements();

    List<Element> getAllElesBySystem(@Param("system") String system);

    List<Element> getAllFuncElesBySystem(@Param("system") String system);

    List<Element> getAllElesBySystemAndFrom(@Param("system") String system, @Param("from") String from);

    List<Element> getAllFuncAndComboElesBySystem(@Param("system") String system);


    List<Element> getAllNotComboElement(@Param("name") String name);

    Element getElementById(@Param("id") String id);

    List<Element> getElementByFrom(@Param("from") String from, @Param("name") String name);

    List<Element> getElementByTypeFrom(@Param("type") String type, @Param("from") String from, @Param("name") String name);


    /**
     * 得到规则输入时可选的因子, 根据input因子得到的衍生function因子ElementFunctionParam
     *
     * @param elements
     * @param name
     * @return
     */
    List<Element> getElementForRuleFunctionElement(@Param("elements") List<String> elements, @Param("type") String type, @Param("name") String name);

    Set<String> getElementByInputElement(@Param("inputElements") Collection<String> inputElements);

    Set<String> getFunctionElementWithNoParam();

    List<String> getElementsBySystem(@Param("inputElements") List<String> inputElements, @Param("system") String system);

}
